home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Loadstar 14
/
014.d81
/
pps #32
< prev
next >
Wrap
Text File
|
2022-08-26
|
2KB
|
120 lines
======================================
Peeks, Pokes, & SYSes -- Part 32
By James Germany Weiler
and Alien Gardner
======================================
When we bought our Commodore 64s, we
expected to be able to program
graphics. We soon found that there
were plenty of programs that would
help us produce graphic images. But
what we wanted was to make our own
programs use graphics.
Well, PEEKs POKEs and SYSes last
touched on graphics in part 19, when
we showed you how to make and use
sprites. Now we think it is time to
leap into the exciting world of
bit-mapped graphics.
Sure, you're thinking that anything
with a name like "bit-mapped graphics"
will be a nightmare to use and under-
stand, and you're partly right. But
what's PEEKs POKEs and SYSes for if
not to make plain even the most
arcane of programmers' tricks?
So, we start simple: What is a BIT?
That's easy! A bit is the smallest,
most fundamental piece of memory in a
computer. It contains only one piece
of information: a yes or a no; a true
or a false; an on or an off; a one or
a zero.
We say a bit is SET if its value is
one and RESET if its value is zero.
But computers don't keep information
in the form of pure bits. They
assemble the bits into words and then
they store the words into memory.
Each memory word in the Commodore-64
is made up of eight bits. An eight bit
word is called a byte.
The value of a byte depends on the
values of the bits that make it up.
Any bit that is a zero has a value
of zero. Any bit that is a one has a
value that varies depending on the
bit's position in the byte. The value
of a byte is equal to the sum of the
values of its bits.
Bit Position Bit value
0 2^0 = 1
1 2^1 = 2
2 2^2 = 4
3 2^3 = 8
4 2^4 = 16
5 2^5 = 32
6 2^6 = 64
7 2^7 = 128
Some examples:
bit:76543210
--------
byte: 00000000 value: 0
byte: 00010101 value: 21
byte: 11111111 value: 255
byte: 10011011 value: 155
-------< continued in Part 33 >-------